package com.cw.controller;

import com.cw.beans.Scrap;
import com.cw.mapper.AssetMapper;
import com.cw.mapper.ScrapMapper;
import com.cw.service.ScrapService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.Date;

@Controller
public class ScarapController {
    @Autowired
    private ScrapMapper scrapMapper;
    @Autowired
    private AssetMapper assetMapper;

    //资产报废
    @RequestMapping("/getscarap")
    public String getScrap(Integer zcAsset, float residual, Model model) {
        //提交报废数据
        scrapMapper.setscrap(zcAsset,residual);
        //修改主表参数报废状态
        assetMapper.setAssetState(zcAsset);
        return "Asset_Scrap";
    }

}
